#ifndef WIDGET_H
#define WIDGET_H

#include <QPushButton>
#include <QString>
#include <QWidget>
#include "qt_windows.h"
QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget

{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();
private slots:
    void buttonClicked();

private:
    void sendKeyEvent(HWND hWnd, QObject* button);
    void switchCases();
    void initKeyMappingWin();
    HWND findFocusWindow();

    struct KeyMap
    {
        QPushButton* uiCtl;
        int qtEnum1; /* 小写字母虚拟键盘码 */
        int qtEnum2; /* 大写字母虚拟键盘码 */
        bool capsSwitch;
        bool shiftSwitch;
        QString lowCase; /* 小写字母 */
        QString upperCase; /* 大写字母 */
    };
private:
    Ui::Widget *ui;
    QVector<KeyMap> keyMapping;
    bool capslock;
    bool shift;
};
#endif // WIDGET_H
